<template>
  <div class="app-container">
    <!-- 查询 -->
    <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" :isDisplayDefaultSearch="false" v-if="isHeaderDisplay">
      <template slot="search">
        <el-form-item label="部门名称">
          <el-input v-model="queryParam.deptName"></el-input>
        </el-form-item>
        <el-form-item label="人员">
          <el-input v-model="queryParam.qry_user"></el-input>
          <!-- <tl-ref-user v-model="queryParam.user" :initDisplayData="queryParam.userName" dataType="id" :singleSelect="true" :readonly="true" @confirm="userRefConfirm"></tl-ref-user> -->
        </el-form-item>
        <el-form-item label="开始日期" size="mini">
          <el-date-picker v-model="queryParam.startDate" placeholder="如：2021-01-01" value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期" size="mini">
          <el-date-picker v-model="queryParam.endDate" placeholder="如：2021-01-01" value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
      </template>
    </tl-list-search>
    <div>
      <!-- 列表选择 -->
      <div class="table-alert-div" ref="selector">
        <el-alert type="success" :closable="false" class="tl-table-alert-info" effect="light">
          <template slot="title">
            已选择&nbsp;<a class="tl-table-alert-info-a1">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
            <a class="tl-table-alert-info-a2" @click="doClearSelected">全部清空</a>
          </template>
        </el-alert>
      </div>
      <!--表格渲染-->
      <el-table class="tl-table" ref="mainTable" :height="tableHeight" resizable-key="tableHeight" :resizable-refs="tableResizeRefs" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" @row-click="doRowClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
        <el-table-column type="index" label="序号" width="55px" align="center"></el-table-column>
        <el-table-column prop="modulename" label="模块名称" width="220px" sortable="custom" sort-by="modulename" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column prop="operateusercode" label="用户编号" width="100px" sortable="custom" sort-by="operateusercode" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column prop="operateusername" label="用户姓名" width="150px" sortable="custom" sort-by="operateusername" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column prop="statisticdate" label="统计日期" width="170px" sortable="custom" sort-by="statisticdate" align="center" header-align="center" :formatter="dateTimeFormat" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column prop="week" label="星期" width="220px" sortable="custom" sort-by="week" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
        <!-- <el-table-column prop="isworkday" label="是否工作日" width="150px" sortable="custom" sort-by="isworkday" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column> -->
        <el-table-column prop="clickcount" label="点击次数" width="150px" sortable="custom" sort-by="clickcount" align="center" header-align="center" :formatter="formatForNull" :show-overflow-tooltip="true"></el-table-column>
      </el-table>
      <!-- 列表分页 -->
      <el-row class="pagebar" ref="pager">
        <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
      </el-row>
      <tl-edit ref="editForm" @refresh="doRefresh"></tl-edit>
    </div>
  </div>
</template>

<script>
/** mixins */
import { mixin_list } from '@tapui/mixins/mixin_list'
/** 子组件 */
import tlEdit from './edit'
/** 工具类 */
import { getAction, putAction, postAction, deleteAction } from '@tapui/utils/http'
export default {
  name: 'misModuleLogDailyStatistics',
  mixins: [mixin_list],
  components: { tlEdit },
  data() {
    return {
      description: '模块操作日志每日统计-列表查询',
      urlPrefix: '/mis/moduleLogDailyStatistics/',
      url: {
        // queryCodeList: '/mis/moduleLogDailyStatistics/dataCodeList'
      },
      // 排序参数
      sorterInfo: {
        sidx: 'operateusercode,statisticdate',
        sord: 'asc'
      }
    }
  },
  methods: {
    formatForNull(row, column, cellValue, index) {
      if (!cellValue) {
        return 0
      } else {
        return cellValue
      }
    }
  }
}
</script>

<style scoped></style>

